<!--编辑菜单-->
<div class="dialog_content">
    <form id="info_form" name="info_form" action="{:U('daohang/edit')}" method="post">
    <table width="100%" class="table_form">
        <tr>
            <th width="100">导航 :</th>
            <td>
            <select name="pid">
                <option value="0">作为一级导航</option>
                {$select_menus}
            </select>
          </td>
        </tr>
        <tr>
        <th>导航名称 :</th>
            <td><input type="text" name="name" id="name" class="input-text" value="{$info.name}"></td>
        </tr>
        <tr>
            <th>新窗口打开 :</th>
            <td>
                <label><input type="radio" name="target" class="radio_target" value="1" <if condition="$info.target eq 1">checked="checked"</if>> 是&nbsp;&nbsp;</label>
                <label><input type="radio" name="target" class="radio_target" value="2" <if condition="$info.target eq 2">checked="checked"</if>> 否</label>
                <label><input type="radio" name="target" class="radio_target" value="3" <if condition="$info.target eq 3">checked="checked"</if>> 其他（触发脚本）</label>
            </td>
        </tr>
        <tr>
            <th>指向链接 :</th>
            <td><input type="text" name="url" id="url" class="input-text" value="{$info.url}"></td>
        </tr>
        <tr>
            <th>备注 :</th>
            <td><textarea name="remark" id="remark" cols="40" rows="3">{$info.remark}</textarea></td>
        </tr>
        <tr>
            <th>是否显示菜单 :</th>
            <td>
                <label><input type="radio" name="display" class="radio_style" value="1" <if condition="$info.display eq 1">checked="checked"</if>> 是&nbsp;&nbsp;</label>
                <label><input type="radio" name="display" class="radio_style" value="0" <if condition="$info.display eq 0">checked="checked"</if>> 否</label>
            </td>
        </tr>
    </table>
    <input name="id" type="hidden" value="{$info.id}">
    </form>
</div>

<script>
$(function(){
    $.formValidator.initConfig({formid:"info_form",autotip:true});
    $("#name").formValidator({ onshow:lang.please_input+'导航名称', onfocus:lang.please_input+'导航名称', oncorrect:lang.input_right}).inputValidator({ min:1, onerror:lang.please_input+'导航名称'});
    $("#url").formValidator({ onshow:lang.please_input+'指向链接', onfocus:lang.please_input+'指向链接', oncorrect:lang.input_right}).inputValidator({ min:1, onerror:lang.please_input+'指向链接'});
    $('#info_form').ajaxForm({success:complate,dataType:'json'});
    function complate(result){
        if(result.errNum === 0){
            $.dialog.get('edit').close();
            $.yhxia.tip({content:result.retData});
            window.location.reload();
        } else {
            $.yhxia.tip({content:result.errMsg, icon:'alert'});
        }
    }
});
</script>